package com.example.Laboratory.Mapper;

import com.example.Laboratory.Entity.Resource_sharing;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface Resource_sharingMapper {

    //添加图片地址
    @Insert("INSERT INTO resource_sharing (resource_sharing_time,resource_sharing_address,resource_sharing_name)VALUES(#{resource_sharing_time},#{resource_sharing_address},#{resource_sharing_name})")
    int addResource_sharing (Resource_sharing r);

    //查找全表
    @Select("SELECT * FROM resource_sharing ")
    List<Resource_sharing> researchResource_sharing ( );

    //根据id查找地址
    @Select("SELECT resource_sharing_address FROM resource_sharing WHERE resource_sharing_id=#{resource_sharing_id}")
    String researchResource_sharing1 (int resource_sharing_id);


    //根据id删除
    @Delete("DELETE FROM resource_sharing WHERE resource_sharing_id=#{resource_sharing_id}")
    int deleteResource_sharing (int resource_sharing_id);

    //修改开放课题
    @Update("UPDATE resource_sharing SET resource_sharing_time=#{resource_sharing_time},resource_sharing_address=#{resource_sharing_address},resource_sharing_name=#{resource_sharing_name} WHERE resource_sharing_id=#{resource_sharing_id}")
    int reviseResource_sharing (Resource_sharing s);
}
